import { Controller } from 'egg';

export default class UserController extends Controller {
  public async register() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.registerService();
  }

  public async login() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.login();
  }

  public async logout() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.logout();
  }

  public async getUserInfo() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.getUserInfo();
  }

  public async getUserList() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.getUserList();
  }

  public async getUserUpdate() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.getUserUpdate();
  }

  public async delUser() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.delUser();
  }

  public async captcha() {
    const { ctx } = this;
    ctx.body = await ctx.service.user.captcha();
  }
}
